
#pragma once


#include <boost/shared_ptr.hpp>
#include "Process.h"


class ProcessManager
{
public:

	typedef boost::shared_ptr<ProcessManager> Ptr;

private:

	ProcessList mProcList;

	// List of processes to initialize.
	ProcessList mInitProcList;

	//! Initializes every uninitialized process.
	//!
	void InitPendingProcs();

public:
	
	//! Updates the processes that should be updated.
	//!
	void Update(int delta);

	//! Updates the processes that should be updated of a given type.
	//!
	void Update(int delta, int type);

	//! Attaches a process to the manager.
	//!
	void Attach( Process::Ptr proc );

	//! Returns a list with every process attached to the manager, including
	//! those that have not been initialized yet.
	//!
	ProcessList GetProcessList();
};